import request from '@/utils/request'

export interface trademarkModel {
    id?: number,
    tmName: string,
    logoUrl: string
}

export interface trademarkPageModel {
    records: trademarkModel[],
    total: number,
    size: number,
    current: number,
    searchCount: boolean,
    pages: number
}

export default {
    // 获取初始化数据
    getTrademarkPage(page: number, limit: number) {
        return request.get<any, trademarkPageModel>(`/admin/product/baseTrademark/${page}/${limit}`)
    },
    // 保存
    save(tm: trademarkModel) {
        return request.post<any, null>('/admin/product/baseTrademark/save', tm)
    },
    // 编辑
    update(tm: trademarkModel) {
        return request.put<any, null>('/admin/product/baseTrademark/update', tm)
    },
    // 删除
    remove(id: number) {
        return request.delete<any, null>(`/admin/product/baseTrademark/remove/${id}`)
    },
    // 获取品牌列表
    getTrademarkList() {
        return request.get<any, trademarkModel[]>('/admin/product/baseTrademark/getTrademarkList')
    }

}